home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 142
/
Volume 142 Oct 17 2011 - Damaged.iso
/
Games
/
parasite-x.swf
/
scripts
/
frame_22
/
DoAction.as
< prev
Wrap
Text File
|
2011-10-17
|
2KB
|
87 lines
stop();
_root.delay = 100;
_root.time1 = 0;
_root.lives = 30 + _root.liveup;
_root.leveltime = 89 * _root.level1;
_root.combo = 1;
_root.spawn = 6;
_root.days = _root.houres * 0.0422;
_root.fire = 0;
_root.Test._y = 927.5;
_root.Test._x = 250.3;
_root.Test._yscale = 4.6 + _root.sizeup;
_root.Test._xscale = 4.6 + _root.sizeup;
_root.Test2._yscale = 34 + _root.sizeup2;
_root.Test2._xscale = 47 + _root.sizeup2;
onMouseDown = function()
{
if(_root.delay >= 30 - _root.firerate)
{
bomb = attachMovie("bomb","bomb",_root.getNextHighestDepth());
bomb._y = Test._y;
bomb._x = Test._x;
bomb._yscale = _root.bombsize;
bomb._xscale = _root.bombsize;
_root.delay = 0;
}
};
onEnterFrame = function()
{
if(_root.gamepaused == 0)
{
bomb.play();
}
else
{
bomb.stop();
}
_root.delay += 0.1;
draw.clear();
i = 0;
while(i < length)
{
me = this["line" + i];
if(i == 0)
{
tx = _root.Test._x;
ty = _root.Test._y;
}
else
{
tx = this["line" + (i - 1)]._x;
ty = this["line" + (i - 1)]._y;
}
xdiff = (tx - me._x) / speed;
ydiff = (ty - me._y) / speed;
if(Math.abs(xdiff) > 1)
{
me._x += xdiff;
}
if(Math.abs(ydiff) > 1)
{
me._y += ydiff;
}
me._x += wind;
me._y += gravity;
draw.lineStyle(length - i,16777215,100);
draw.moveTo(me._x,me._y);
draw.lineTo(tx,ty);
me.swapDepths(1);
_root.Test.swapDepths(999);
i++;
}
};
var keyListener = new Object();
keyListener.onKeyDown = function()
{
if(_root.ammo > 499)
{
_root.ammo -= 30;
bomb = attachMovie("bomb","bomb",_root.getNextHighestDepth());
bomb._y = Test._y;
bomb._x = Test._x;
bomb._rotation = Test._rotation;
}
};
Key.addListener(keyListener);